﻿<%@ Page Title="" Language="C#" MasterPageFile="~/LTR/MlyLtrMaster.Master" AutoEventWireup="true" CodeBehind="AlertSet.aspx.cs" Inherits="MLY.LTR.AlertSet" Theme="Skin1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="titleHolder" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="data_transfer_container" class="SC_FloatRight" >
    <div id="data_transfer_inside" class="SC_Align">
        <asp:Label ID="TitleLabel" runat="server" CssClass="SC_BigText" Text="<%$ Dict:AlertSet.Title %>"></asp:Label>
        <br /><br />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
        
            <asp:GridView ID="AlertSetGrid" runat="server" SkinID="GridViewSkin" AutoGenerateColumns="false"
             DataSourceID="AlertSetDataSource" AllowPaging="false">
                <HeaderStyle CssClass="SC_grid_header"  />
                <RowStyle CssClass="SC_grid_cell"  /> 
                <Columns>
                    <asp:BoundField DataField="CustomerWorkOrderNumber" HeaderText="<%$ Dict:clientAddWo.CustomerWorkOrderNumber %>" />
                    <asp:BoundField DataField="ContractorWorkOrderNumber" HeaderText="<%$ Dict:clientAddWo.ContractorWorkOrderNumber %>" />
                    <asp:BoundField DataField="OrderNumber" HeaderText="<%$ Dict:clientAddWo.OrderNumber %>" />
                    <asp:BoundField DataField="ContractorLotNumber" HeaderText="<%$  Dict:clientAddWo.ContractorLotNumber%>" />
                    <asp:BoundField DataField="CustomerCatalougeCode" HeaderText="<%$ Dict:clientAddWo.CustomerCatalougeCode %>" />
                    <asp:BoundField DataField="ProductDescription" HeaderText="<%$ Dict:clientAddWo.ProductDescription %>" />
                    <asp:TemplateField HeaderText="<%$ Dict:clientAddWo.Quantity %>">
                    <ItemTemplate>
                        <asp:HiddenField ID="WorkOrderIdHiddenField" runat="server" Value='<%# Eval("WorkOrderId") %>' />
                        <asp:TextBox ID="QuantityTextBox" runat="server" Text='<%# Eval("Quantity") %>' MaxLength="10" Width="40" 
                         Enabled='<%# (Eval("Quantity").ToString() == Eval("originalQuantity").ToString()) && (Eval("originalWoForDist").ToString() != "null") %>'></asp:TextBox>
                    </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="<%$ Dict:clientAddWo.PlannedDelivaryDate %>">
                    <ItemTemplate>
                        <% if (!IsClient())
                           {%>
                        <KBMControls:KBMReadOnlyTxtBox runat="server" ID="PlannedDelivaryDateTextBox" Text='<%# Eval("PlannedDelivaryDate") %>'></KBMControls:KBMReadOnlyTxtBox>
                        
                        <KBMControls:KbmCalendar TargetControlID="PlannedDelivaryDateTextBox" runat="server" ID="PlannedKbmCalendar" ></KBMControls:KbmCalendar>
                        <% }
                           else
                           { %>
                            <asp:Label ID="PlannedDelivaryDateLabel" runat="server" Text='<%# Eval("PlannedDelivaryDate") %>' ></asp:Label>
                        <% } %>
                    </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="<%$ Dict:clientAddWo.RequestedDelivaryDate %>">
                    <ItemTemplate>
                        <% if(IsClient()) { %>
                        <KBMControls:KBMReadOnlyTxtBox runat="server" ID="RequestedDelivaryDateTextBox" Text='<%# Eval("RequestedDelivaryDate") %>'></KBMControls:KBMReadOnlyTxtBox>
                        <KBMControls:KbmCalendar TargetControlID="RequestedDelivaryDateTextBox" runat="server" ID="RequestedKbmCalendar"></KBMControls:KbmCalendar>
                        <% } else { %>
                        <asp:Label ID="RequestedDelivaryDateLabel" runat="server" Text='<%# Eval("RequestedDelivaryDate") %>' ></asp:Label>
                        <% } %>
                    </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="<%$ Dict:clientAddWo.ContractorWorkOrderNumber %>">
                    <ItemTemplate>
                        <% if (!IsClient())
                           { %>
                                <asp:TextBox ID="SupplierWorkOrderNumberTextBox" runat="server"  Width="80" Text='<%# Eval("ContractorWorkOrderNumber") %>' ></asp:TextBox>
                        <% }
                           else
                           { %>
                                <asp:Label ID="SupplierWorkOrderNumberLabel" runat="server" Text='<%# Eval("ContractorWorkOrderNumber") %>'></asp:Label>
                                
                        <% } %>
                    </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="<%$ Dict:clientAddWo.CustomerWorkOrderNumber %>">
                    <ItemTemplate>
                        <% if (IsClient())
                           { %>
                                <asp:TextBox ID="CustomerWorkOrderNumberTextBox" runat="server"  Width="80" Text='<%# Eval("CustomerWorkOrderNumber") %>' ></asp:TextBox>
                        <% }
                           else
                           { %>
                                <asp:Label ID="CustomerWorkOrderNumberLabel" runat="server" Text='<%# Eval("CustomerWorkOrderNumber") %>'></asp:Label>
                                
                        <% } %>
                    </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:Button ID="UpdateButton" runat="server" Text="<%$ Dict:adminDefault.lblUpdate %>" CssClass="SC_Button" OnClick="UpdateAll" />
            <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
            <ProgressTemplate>
                <asp:Image ID="ProgressImage" runat="server" ImageUrl="~/Images/ajax-loaderBar.gif" />              
            </ProgressTemplate>            
            </asp:UpdateProgress>
            <asp:Label ID="MessageLabel" runat="server" ></asp:Label>
        </ContentTemplate>
        </asp:UpdatePanel>
    </div></div>
    <asp:SqlDataSource ID="AlertSetDataSource" runat="server" SelectCommandType="StoredProcedure" 
    ConnectionString="<%$ ConnectionStrings:MLYConnectionString %>" SelectCommand="SCCover_GetAlertSet"></asp:SqlDataSource> 

</asp:Content>
